package cn.bugDance.domain.rebate.service;

import cn.bugDance.domain.rebate.model.entity.RebateCreditShopCartEntity;
import cn.bugDance.domain.rebate.repository.IRebateRepository;
import cn.bugDance.types.common.Constants;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

@Service
@Slf4j
public class RebateQuotaService implements IRebateQuotaService{

    @Resource
    private IRebateRepository rebateRepository;


    @Override
    public Boolean isCalendarSignRebate(String userId, Long activityId, String outBusinessNo) {
        String key = userId + Constants.UNDERLINE + activityId + Constants.UNDERLINE + outBusinessNo;
        return rebateRepository.isCalendarSignRebate(key);
    }

    @Override
    public void RebateCreditRecharge(RebateCreditShopCartEntity rebateCreditShopCartEntity) {
        rebateRepository.creditRecharge(rebateCreditShopCartEntity);
    }
}
